import request from '@/utils/request'

export function getOrderList(data, showLoading=true) {
  return request({
    url: `/travel/order/orderList`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

// 评论
export function addAppraise(data, showLoading=true){
  return request({
    url: `/travel/appraise/addAppraise`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

// 订单提交
export function addOrder(data, showLoading=true) {
  return request({
    url: `/travel/order/addOrder`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}
// 支付产品
export function payOrder(data, showLoading=true) {
  return request({
    url: `/travel/order/payOrder`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

// 删除订单
export function deleteOrder(data, showLoading=true) {
  return request({
    url: `/travel/order/deleteOrder`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

export function cancelOrder(data, showLoading=true) {
  return request({
    url: `/travel/order/cancelOrder`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    showLoading,
    data
  })
}

